package Chapter2.Comparing.c6;

import javax.jws.soap.SOAPBinding;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class MapDemo2 {
    public static void main(String[] args) {

        Map<String, User> userMap;
        userMap = new LinkedHashMap<>();
         User u1 = new User("Tim",20);
         User u2 = new User("Tommy",19);
         User u3 = new User("Tiddy",18);
         User u4 = new User("Tina",22);

         userMap.put("u1",u1);
         userMap.put("u2",u2);
         userMap.put("u3",u3);
         userMap.put("u4",u4);

         User u = userMap.get("u1");
         System.out.println(u);
         Set<String> keys = userMap.keySet();
         for(String s:keys ) {
             System.out.println(s+"===>"+userMap.get(s));

         }



    }
}
